package com.yellowpage.wf.dao;

import com.yellowpage.white.dao.BaseDaoHibernateImpl;
import java.util.List;
import java.util.Map;
import com.yellowpage.wf.data.WorkHistory;

public class WorkHistoryDaoImpl extends BaseDaoHibernateImpl<WorkHistory, Long> implements WorkHistoryDao {

	public WorkHistoryDaoImpl() {
		super(WorkHistory.class);
	}		
	public void addHistory(Long n_id,List partList,Map paramMap)
	{	
		if (partList.size() == 0 || partList == null)
		{
			return;
		}
		for (int i=0;i<partList.size();i++)
		{
			Map tempMap = (Map) partList.get(i);
			WorkHistory  workhistory = new WorkHistory();
			workhistory.setNodeInstanceId(n_id);
			workhistory.setParticipantsId(Long.valueOf(tempMap.get("PARTICIPANTS_ID").toString()));
			workhistory.setParticipant(tempMap.get("PARTICIPANT_NAME").toString());
			workhistory.setValue01(paramMap.get("VALUE_01").toString());
			workhistory.setValue02(paramMap.get("VALUE_02").toString());
			workhistory.setValue03(paramMap.get("VALUE_03").toString());
			workhistory.setValue04(paramMap.get("VALUE_04").toString());
			workhistory.setValue05(paramMap.get("VALUE_05").toString());
			this.save(workhistory);
		}
		
	}

}	